<%--
  Created by IntelliJ IDEA.
  User: 10393
  Date: 2020/6/17
  Time: 18:58
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="utf-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<c:set var="request" value="${pageContext.request.contextPath}"/>
	<title></title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport"
		  content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" href="${request}/static/plugins/layuiadmin/layui/css/layui.css" media="all">
	<link rel="stylesheet" href="${request}/static/plugins/layuiadmin/style/admin.css" media="all">
</head>
<body>
<div class="layui-fluid">
	<div class="layui-card">
		<div class="layui-card-body">

			<table id="vacationList" lay-filter="LAY-app-content-comm"></table>

		</div>
	</div>
</div>
<script type="text/html" id="titleTpl">
	{{#  if(d.id < 100){ }}
	<a href="/detail/{{d.id}}" class="layui-table-link">{{d.title}}</a>
	{{#  } else { }}
	{{d.title}}(普通用户)
	{{#  } }}
</script>
<script src="${request}/static/plugins/layuiadmin/layui/layui.js" charset="UTF-8"></script>
<script>
    layui.config({
        base: '${request}/static/plugins/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'contlist', 'table', 'laypage'], function () {
        var $ = layui.$
            , admin = layui.admin
            , form = layui.form
            , table = layui.table
            , laypage = layui.laypage;

        //方法级渲染
        table.render({
            elem: '#vacationList'
            , url: '${request}/vacation/applyVacationList.html' //向后端默认传page和limit
            , cols: [[
                {type: 'numbers', fixed: 'left'}
                ,{field: 'vacationReqId', title: '申请编号'}
                ,{field: 'empId', title: '员工员工'}
                ,{field: 'submitTime', title: '申请提交时间'}
                , {field: 'beginTime', title: '开始时间',templet : "<div>{{layui.util.toDateString(d.beginTime, 'yyyy-MM-dd')}}</div>"}
                , {field: 'endTime', title: '结束时间',templet : "<div>{{layui.util.toDateString(d.endTime, 'yyyy-MM-dd')}}</div>"}
                , {field: 'vacationTime', title: '请假天数'}
                , {field: 'reqStatus', title: ' 审核状态'}
            ]]
            , page: true
            , limit: 15
            , limits: [5, 10, 15, 20]
            , id: 'applyVacationList'
            , request: {
                pageName: 'pageNum',
                limitName: 'pageSize'  //如不配置，默认为page=1&limit=10
            }
            , done: function (res, curr, count) {
                //如果是异步请求数据方式，res即为你接口返回的信息。
                //如果是直接赋值的方式，res即为：{data: [], count: 99} data为当前页数据、count为数据总长度
                console.log(res);

                //得到当前页码
                console.log(curr);

                //得到数据总量
                console.log(count);
            }

        });
	});
</script>
</body>
</html>
